﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlTestJavaScript.ascx.cs" Inherits="UserControl_ControlTestJavaScript" %>
<script type="text/javascript">

    function pageLoad() {

        //Ngày
        $(function () {
            $("#<%= txtFromDate.ClientID %>").datePicker(
	                {
	                    clickInput: true,
	                    startDate: '01/01/1970'
	                }
	                );
        });

        $("#<%= txtFromDate.ClientID %>").bind(
		            'dpClosed', function (e, selectedDates) {
		                var d = selectedDates[0];
		                if (d) {
		                    d = new Date(d);
		                    $("#<%= txtToDate.ClientID %>").dpSetStartDate(d.addDays(0).asString());
		                }
		            }
	                    );

        $(function () {
            $("#<%= txtToDate.ClientID %>").datePicker(
	                {
	                    clickInput: true

	                }
	                );
        });

        $("#<%= txtToDate.ClientID %>").bind(
		           'dpClosed', function (e, selectedDates) {
		               var d = selectedDates[0];
		               if (d) {
		                   d = new Date(d);
		                   $("#<%= txtFromDate.ClientID %>").dpSetEndDate(d.addDays(0).asString());
		               }
		           }
	            );

        $("#<%= imgBtnAdd.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }

    }
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    
                <div class="direct_container_right_titletop direct_colleft">
                    Báo cáo doanh số theo mặt hàng
                </div>
                
                <!-- Button chuc nang-->
                <div class="direct_menu_report_page direct_colleft">
                    <asp:ImageButton ID="imgBtnAdd" CausesValidation="false" onclick="imgBtnAdd_Click" ToolTip="Lấy dữ liệu"  ImageUrl="~/Images/Document.png" Width="32px" Height="32px" runat="server" />
             </div>
                <!-- End Button chuc nang-->
                <div class="clear"></div>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        <asp:TextBox ID="txtFromDate" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
                 <hr />
    </ContentTemplate>
</asp:UpdatePanel>
